﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using CentaLine.DAL;
using CentaLine.Model;
using CentaLine.Repository;
using CentaLine.Infrastructure;
using System.Diagnostics;

namespace NunitTest
{
    [TestFixture]
    public class CounselorTest
    {
        [Test]
        public void GetDirectorInfoByCounselorDALTest()
        {
            CounselorManager counselorManager = new CounselorManager();
            Counselor counselor = new Counselor { Id = "AA40911", Name = "" };
            Director d = counselorManager.GetCounselor(counselor.Id).Director;
            Assert.AreEqual(d.Name,"王逸红");
        }

        [Test]
        public void GetCounselorTest()
        {
            Stopwatch sp = new Stopwatch();
            sp.Start();
            CounselorManager counselorManager = new CounselorManager();
            var c = counselorManager.GetCounselor("AB33221");
            sp.Stop();
            Logger.Log.Info("耗时："+sp.Elapsed);
            Assert.AreEqual("杨婷婷", c.Name);
        }


        [Test]
        public void GetCounrsorByMobileTest()
        {
            Stopwatch sp = new Stopwatch();
            sp.Start();
            CounselorManager counselorManager = new CounselorManager();
            var c = counselorManager.GetCounrsorByMobile("18221866275");
            sp.Stop();
            Logger.Log.Info("耗时：" + sp.Elapsed);
            Assert.AreEqual("杨婷婷", c.Name);
        }

    }
}
